home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume26 / pbmplus / patch10dec91 / part01 next >
Encoding:
Text File  |  1991-12-14  |  55.8 KB  |  1,930 lines

  1. Newsgroups: comp.sources.misc
  2. From: jef@well.sf.ca.us (Jef Poskanzer)
  3. Subject:  v26i106:  pbmplus - Extended Portable Bitmap Toolkit, Patch10dec91, Part01/05
  4. Message-ID: <csm-v26i106=pbmplus.193549@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 4c628c5a906896654c8cf9de413c4a44
  6. Date: Sun, 15 Dec 1991 01:43:57 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jef@well.sf.ca.us (Jef Poskanzer)
  10. Posting-number: Volume 26, Issue 106
  11. Archive-name: pbmplus/patch10dec91/part01
  12. Environment: UNIX
  13. Patch-To: pbmplus: Volume 23, Issue 36-59
  14.  
  15. This update fixes some nasty bugs in pnmtotiff, adds a new set of
  16. Imakefiles from Rainer Klute, and adds four new programs from John
  17. Walker: pgmcrater, ppmforge, ppmtoacad, and sldtoppm.  Plus various
  18. minor bugfixes.
  19.  
  20. The update is in five parts.  Unshar the parts in your pbmplus source
  21. directory.  These shars contain new files as well as a file p121091.diffs.
  22. Apply the actual patches by:
  23.  
  24. patch -p < p121091.diffs
  25.  
  26. ---
  27. Jef
  28.  
  29.            Jef Poskanzer  jef@well.sf.ca.us  apple!well!jef
  30.  
  31. - - - - - - - - - -
  32.  
  33. #!/bin/sh
  34. # This is a shell archive (produced by shar 3.49)
  35. # To extract the files from this archive, save it to a file, remove
  36. # everything above the "!/bin/sh" line above, and type "sh file_name".
  37. #
  38. # made 12/13/1991 19:45 UTC by kent@sparky.IMD.Sterling.COM
  39. # Source directory /home/kent/mod/csm/queue/pbm/test
  40. #
  41. # existing files will NOT be overwritten unless -c is specified
  42. #
  43. # This is part 1 of a multipart archive                                    
  44. # do not concatenate these parts, unpack them in order with /bin/sh        
  45. #
  46. # This shar contains:
  47. # length  mode       name
  48. # ------ ---------- ------------------------------------------
  49. #   1568 -rw-rw-r-- Imakefile
  50. #   3569 -rw-rw-r-- Imakefile.tiff
  51. #   6893 -rw-rw-r-- Pbmplus.tmpl
  52. #  77113 -rw-rw-r-- p121091.diffs
  53. #   5156 -rw-rw-r-- pbm/Imakefile
  54. #   3534 -rw-rw-r-- pgm/Imakefile
  55. #   5160 -rw-rw-r-- pgm/pgmcrater.1
  56. #  10318 -rw-rw-r-- pgm/pgmcrater.c
  57. #   5158 -rw-rw-r-- pnm/Imakefile
  58. #   5811 -rw-rw-r-- ppm/Imakefile
  59. #  15385 -rw-rw-r-- ppm/ppmforge.1
  60. #  27513 -rw-rw-r-- ppm/ppmforge.c
  61. #   4290 -rw-rw-r-- ppm/autocad.h
  62. #   4541 -rw-rw-r-- ppm/ppmtoacad.1
  63. #  11612 -rw-rw-r-- ppm/ppmtoacad.c
  64. #   4785 -rw-rw-r-- ppm/sldtoppm.1
  65. #  17951 -rw-rw-r-- ppm/sldtoppm.c
  66. #
  67. rm -f Imakefile pbm/Imakefile pgm/Imakefile ppm/Imakefile pnm/Imakefile
  68. if test -r _shar_seq_.tmp; then
  69.     echo 'Must unpack archives in sequence!'
  70.     echo Please unpack part `cat _shar_seq_.tmp` next
  71.     exit 1
  72. fi
  73. # ============= Imakefile ==============
  74. if test -f 'Imakefile' -a X"$1" != X"-c"; then
  75.     echo 'x - skipping Imakefile (File already exists)'
  76.     rm -f _shar_wnt_.tmp
  77. else
  78. > _shar_wnt_.tmp
  79. echo 'x - extracting Imakefile (Text)'
  80. sed 's/^X//' << 'SHAR_EOF' > 'Imakefile' &&
  81. /* Imakefile for pbmplus tools.
  82. X *
  83. X * Copyright (C) 1991 by Rainer Klute.
  84. X *
  85. X * Permission to use, copy, modify, and distribute this software and its
  86. X * documentation for any purpose and without fee is hereby granted, provided
  87. X * that the above copyright notice appear in all copies and that both that
  88. X * copyright notice and this permission notice appear in supporting
  89. X * documentation.  This software is provided "as is" without express or
  90. X * implied warranty.
  91. X */
  92. X
  93. #include <Pbmplus.tmpl>
  94. X
  95. #define IHaveSubdirs
  96. #define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
  97. X
  98. #if BuildLibTiff
  99. SUBDIRS = TiffDir PbmDir PgmDir PpmDir PnmDir
  100. #else
  101. SUBDIRS = PbmDir PgmDir PpmDir PnmDir
  102. #endif
  103. X
  104. MakeSubdirs($(SUBDIRS))
  105. DependSubdirs($(SUBDIRS))
  106. X
  107. World::
  108. X        @echo ""
  109. X        @echo "Building PBMPLUS"
  110. X        @echo ""
  111. X        @date
  112. X        @echo ""
  113. X    $(MAKE) $(MFLAGS) Makefiles
  114. X        $(MAKE) $(MFLAGS) clean
  115. X        $(MAKE) $(MFLAGS) includes
  116. X        $(MAKE) $(MFLAGS) depend
  117. X        $(MAKE) $(MFLAGS)
  118. X        @echo ""
  119. X        @date
  120. X        @echo ""
  121. X        @echo "Full build of PBMPLUS complete."
  122. X        @echo ""
  123. X
  124. Everything::
  125. X        @echo ""
  126. X        @echo "Rebuilding PBMPLUS"
  127. X        @echo ""
  128. X        @date
  129. X        @echo ""
  130. X        $(MAKE) $(MFLAGS) Makefiles
  131. X        $(MAKE) $(MFLAGS) includes
  132. X        $(MAKE) $(MFLAGS) depend
  133. X        $(MAKE) $(MFLAGS)
  134. X        @echo ""
  135. X        @date
  136. X        @echo ""
  137. X        @echo "Rebuild of PBMPLUS complete."
  138. X        @echo ""
  139. X
  140. #if InstallIncludes
  141. InstallMultipleFlags(pbmplus.h,$(PBMPLUSDIR)$(PBMPLUSINCDIR),$(INSTINCFLAGS))
  142. #endif
  143. SHAR_EOF
  144. chmod 0664 Imakefile ||
  145. echo 'restore of Imakefile failed'
  146. Wc_c="`wc -c < 'Imakefile'`"
  147. test 1568 -eq "$Wc_c" ||
  148.     echo 'Imakefile: original size 1568, current size' "$Wc_c"
  149. rm -f _shar_wnt_.tmp
  150. fi
  151. # ============= Imakefile.tiff ==============
  152. if test -f 'Imakefile.tiff' -a X"$1" != X"-c"; then
  153.     echo 'x - skipping Imakefile.tiff (File already exists)'
  154.     rm -f _shar_wnt_.tmp
  155. else
  156. > _shar_wnt_.tmp
  157. echo 'x - extracting Imakefile.tiff (Text)'
  158. sed 's/^X//' << 'SHAR_EOF' > 'Imakefile.tiff' &&
  159. /* Imakefile for tiff library.
  160. X *
  161. X * Copyright (C) 1991 by Rainer Klute.
  162. X */
  163. X
  164. /*
  165. X * Tag Image File Format Library
  166. X *
  167. X * Copyright (c) 1988, 1989, 1990, 1991 Sam Leffler
  168. X * Copyright (c) 1991 Silicon Graphics, Inc.
  169. X * 
  170. X * Permission to use, copy, modify, distribute, and sell this software and 
  171. X * its documentation for any purpose is hereby granted without fee, provided
  172. X * that (i) the above copyright notices and this permission notice appear in
  173. X * all copies of the software and related documentation, and (ii) the names of
  174. X * Sam Leffler and Silicon Graphics may not be used in any advertising or
  175. X * publicity relating to the software without the specific, prior written
  176. X * permission of Stanford and Silicon Graphics.
  177. X * 
  178. X * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  179. X * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  180. X * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  181. X * 
  182. X * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  183. X * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  184. X * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  185. X * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  186. X * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  187. X * OF THIS SOFTWARE.
  188. X */
  189. X
  190. /*
  191. X * Library-wide configuration defines:
  192. X *    SUBFILE_COMPAT    include compat code for bad SubFileType tag
  193. X *    JPEG_SUPPORT    add support for C-Cube JPEG tags & JPEG algorithm
  194. X *
  195. X * Compression configuration defines:
  196. X *    CCITT_SUPPORT    add support for CCITT Group 3 & 4 algorithms
  197. X *    PACKBITS_SUPPORT    add support for Macintosh PackBits algorithm
  198. X *    LZW_SUPPORT    add support for LZW algorithm
  199. X *    THUNDER_SUPPORT    add support for ThunderScan 4-bit RLE algorithm
  200. X *    NEXT_SUPPORT    add support for NeXT 2-bit RLE algorithm
  201. X *    JPEG_SUPPORT    add support for C-Cube JPEG tags & JPEG algorithm
  202. X *
  203. X * Note that if you change the library-wide configuration, you'll
  204. X * need to manual force a full rebuild.  Changing the configuration
  205. X * of which compression algorithms are included in the library is
  206. X * automatically handled (i.e. tif_compress.o has a dependency on
  207. X * the Makefile).
  208. X */
  209. X
  210. CONF_COMPRESSION=\
  211. X    -DPACKBITS_SUPPORT \
  212. X    -DLZW_SUPPORT \
  213. X    -DCCITT_SUPPORT \
  214. X    -DTHUNDER_SUPPORT  \
  215. X    -DNEXT_SUPPORT  \
  216. X    ${NULL}
  217. CONF_LIBRARY=\
  218. X    -DUSE_VARARGS=1 \
  219. X    -DUSE_PROTOTYPES=0 \
  220. X    ${NULL}
  221. X
  222. X
  223. #define LibTiff libtiff.a
  224. #define DepLibTiff LibTiff
  225. #include <../Pbmplus.tmpl>
  226. X
  227. DEFINES = ${CONF_LIBRARY}
  228. X
  229. SRCS = tif_fax3.c tif_fax4.c tif_ccittrle.c tif_close.c tif_compat.c \
  230. X       tif_compress.c tif_dir.c tif_dumpmode.c tif_error.c tif_jpeg.c \
  231. X       tif_flush.c tif_lzw.c tif_open.c tif_packbits.c tif_print.c \
  232. X       tif_read.c tif_swab.c tif_strip.c tif_thunder.c tif_tile.c \
  233. X       tif_warning.c tif_write.c tif_next.c
  234. X
  235. OBJS= tif_fax3.o tif_fax4.o tif_ccittrle.o tif_close.o tif_compat.o \
  236. X      tif_compress.o tif_dir.o tif_dumpmode.o tif_error.o tif_jpeg.o \
  237. X      tif_flush.o tif_lzw.o tif_open.o tif_packbits.o tif_print.o tif_read.o \
  238. X      tif_strip.o tif_swab.o tif_thunder.o tif_tile.o tif_warning.o \
  239. X      tif_write.o tif_next.o
  240. X
  241. AllTarget($(LIBTIFF))
  242. X
  243. includes:: g3states.h
  244. X
  245. g3states.h: mkg3states.c t4.h
  246. X    ${CC} -o mkg3states ${CFLAGS} mkg3states.c
  247. X    ./mkg3states > g3states.h
  248. X
  249. clean::
  250. X    $(RM) g3states.h mkg3states
  251. X
  252. DependTarget()
  253. X
  254. NormalLibraryObjectRule()
  255. NormalLibraryTarget(tiff,$(OBJS))
  256. SpecialObjectRule(tif_compress.o,,${CONF_COMPRESSION})
  257. X
  258. #if InstallLibraries
  259. InstallLibrary(tiff,$(PBMPLUSDIR)$(PBMPLUSLIBDIR))
  260. #endif
  261. SHAR_EOF
  262. chmod 0664 Imakefile.tiff ||
  263. echo 'restore of Imakefile.tiff failed'
  264. Wc_c="`wc -c < 'Imakefile.tiff'`"
  265. test 3569 -eq "$Wc_c" ||
  266.     echo 'Imakefile.tiff: original size 3569, current size' "$Wc_c"
  267. rm -f _shar_wnt_.tmp
  268. fi
  269. # ============= Pbmplus.tmpl ==============
  270. if test -f 'Pbmplus.tmpl' -a X"$1" != X"-c"; then
  271.     echo 'x - skipping Pbmplus.tmpl (File already exists)'
  272.     rm -f _shar_wnt_.tmp
  273. else
  274. > _shar_wnt_.tmp
  275. echo 'x - extracting Pbmplus.tmpl (Text)'
  276. sed 's/^X//' << 'SHAR_EOF' > 'Pbmplus.tmpl' &&
  277. /* Imake template and rules for PBMPLUS
  278. X *
  279. X * Copyright (C) 1991 Rainer Klute
  280. X *
  281. X * Permission to use, copy, modify, distribute, and sell this software and
  282. X * its documentation for any purpose is hereby granted without fee, provided
  283. X * that the above copyright notice appear in all copies and that both that
  284. X * copyright notice and this permission notice appear in supporting
  285. X * documentation, and that the copyright holder's name not be used in
  286. X * advertising or publicity pertaining to distribution of the software
  287. X * without specific, written prior permission. The copyright holder makes
  288. X * no representations about the suitability of this software for any
  289. X * purpose. It is provided "as is" without express or implied warranty.
  290. X */
  291. X
  292. /* CONFIGURE: PBMPLUS's support for TIFF files depends on the library from
  293. X * Sam Leffler's TIFF Software package - see the OTHER.SYSTEMS file for a
  294. X * full description and access information.  To configure PBMPLUS to use the
  295. X * library: first, if necessary, fetch the TIFF Software, unpack it in a
  296. X * scratch directory somewhere, and move the libtiff subdirectory right here
  297. X * into the PBMPLUS top-level directory.  Then move the file Imakefile.tiff
  298. X * to libtiff/Imakefile.
  299. X *
  300. X * Libtiff is pretty good about portability, but there are some machines
  301. X * it has problems on.  If you run into problems, you may wish to contact
  302. X * Sam directly, at the address listed in the OTHER.SYSTEMS file.
  303. X *
  304. X * By the way, you must have at least version 2.4 of libtiff.  Earlier
  305. X * versions will not work.
  306. X */
  307. #ifndef BuildLibTiff
  308. #define BuildLibTiff     YES
  309. #endif
  310. X
  311. /* CONFIGURE: You may edit the symbol definitions below as you see fit,
  312. X * e.g. change the definition of "InstallLibraries" and "InstallIncludes"
  313. X * to "YES" if you want to have the libraries and include files installed.
  314. X */
  315. #ifndef InstallBinaries
  316. #define InstallBinaries  YES
  317. #endif
  318. #ifndef InstallManuals
  319. #define InstallManuals   YES
  320. #endif
  321. #ifndef InstallLibraries
  322. #define InstallLibraries NO
  323. #endif
  324. #ifndef InstallIncludes
  325. #define InstallIncludes  NO
  326. #endif
  327. X
  328. /* CONFIGURE: Normally the Imakefiles build and install separate binaries for
  329. X * each program.  However, on some systems (especially those without shared
  330. X * libraries) this can mean a lot of space.  In this case you might try
  331. X * building a "merge" instead.  The idea here is to link all the binaries
  332. X * together into one huge executable, with a tiny dispatch program as the
  333. X * main.  Then the merged binary is installed with file-system links for
  334. X * each program it includes.  The dispatch routine can tell which program
  335. X * to run by looking at argv[0].  On a Sun3 under SunOS 3.5 the space for
  336. X * executables went from 2.9 meg to .36 meg.
  337. X *
  338. X * Note that if you make a "merge", the executables don't get created
  339. X * until you do the install.
  340. X */
  341. #ifndef InstallMerged
  342. #define InstallMerged NO
  343. #endif
  344. X
  345. X
  346. /* CONFIGURE: Where to install PBMPLUS (defaults to the X11 directories). */
  347. #ifndef PbmplusDir
  348. #define PbmplusDir    /* defaults to nothing */
  349. #endif
  350. #ifndef PbmplusBinDir
  351. #define PbmplusBinDir $(BINDIR)
  352. #endif
  353. #ifndef PbmplusManDir
  354. #define PbmplusManDir $(MANDIR)
  355. #endif
  356. #ifndef PbmplusLibDir
  357. #define PbmplusLibDir $(USRLIBDIR)
  358. #endif
  359. #ifndef PbmplusIncDir
  360. #define PbmplusIncDir $(INCDIR)
  361. #endif
  362. X
  363. /* End of configurable definitions. */
  364. X
  365. /* Subdirectories: */
  366. #ifndef PbmDir
  367. #define PbmDir TOPDIR/pbm
  368. #endif
  369. #ifndef PgmDir
  370. #define PgmDir TOPDIR/pgm
  371. #endif
  372. #ifndef PpmDir
  373. #define PpmDir TOPDIR/ppm
  374. #endif
  375. #ifndef PnmDir
  376. #define PnmDir TOPDIR/pnm
  377. #endif
  378. #ifndef TiffDir
  379. #define TiffDir TOPDIR/libtiff
  380. #endif
  381. X
  382. /* Libraries: */
  383. #ifndef LibPbm
  384. #define LibPbm $(PBMDIR)/libpbm.a
  385. #endif
  386. #ifndef LibPgm
  387. #define LibPgm $(PGMDIR)/libpgm.a
  388. #endif
  389. #ifndef LibPpm
  390. #define LibPpm $(PPMDIR)/libppm.a
  391. #endif
  392. #ifndef LibPnm
  393. #define LibPnm $(PNMDIR)/libpnm.a
  394. #endif
  395. #ifndef LibTiff
  396. #define LibTiff $(TIFFDIR)/libtiff.a
  397. #endif
  398. X
  399. /* Dependency libraries: */
  400. #ifndef DepLibPbm
  401. #define DepLibPbm LibPbm
  402. #endif
  403. #ifndef DepLibPgm
  404. #define DepLibPgm LibPgm
  405. #endif
  406. #ifndef DepLibPpm
  407. #define DepLibPpm LibPpm
  408. #endif
  409. #ifndef DepLibPnm
  410. #define DepLibPnm LibPnm
  411. #endif
  412. #ifndef DepLibTiff
  413. #define DepLibTiff LibTiff
  414. #endif
  415. X
  416. X   PBMPLUSDIR = PbmplusDir
  417. PBMPLUSBINDIR = PbmplusBinDir
  418. PBMPLUSMANDIR = PbmplusManDir
  419. PBMPLUSLIBDIR = PbmplusLibDir
  420. PBMPLUSINCDIR = PbmplusIncDir
  421. X
  422. X       PBMDIR = PbmDir
  423. X       PGMDIR = PgmDir
  424. X       PPMDIR = PpmDir
  425. X       PNMDIR = PnmDir
  426. X      TIFFDIR = TiffDir
  427. X
  428. X       LIBPBM = LibPbm
  429. X       LIBPGM = LibPgm
  430. X       LIBPPM = LibPpm
  431. X       LIBPNM = LibPnm
  432. X      LIBTIFF = LibTiff
  433. X    DEPLIBPBM = DepLibPbm
  434. X    DEPLIBPGM = DepLibPgm
  435. X    DEPLIBPPM = DepLibPpm
  436. X    DEPLIBPNM = DepLibPnm
  437. X   DEPLIBTIFF = DepLibTiff
  438. X
  439. #if InstallMerged
  440. X
  441. #ifndef InstallPbmplusPrograms
  442. #define InstallPbmplusPrograms(list,dest,flags)                             @@\
  443. install:: list                                                              @@\
  444. X    MakeDir($(DESTDIR)dest)                                             @@\
  445. X    @case '${MFLAGS}' in *[i]*) set +e;; esac; \                        @@\
  446. X    for i in list; do \                                                 @@\
  447. X        (set -x; cd $(DESTDIR)dest; $(RM) $$i;  \                   @@\
  448. X        $(LN) $(MERGE) $$i); \                                      @@\
  449. X    done
  450. #endif /* InstallPbmplusPrograms */
  451. X
  452. #ifndef NormalPbmplusProgramTarget
  453. #define NormalPbmplusProgramTarget(program)                                 @@\
  454. program.o: program.c                                                        @@\
  455. X    ObjectCompile("-Dmain=$*_main")                                     @@\
  456. X    LinkFile(program,$(MERGE))
  457. #endif /* NormalPbmplusProgramTarget */
  458. X
  459. #ifndef NormalPbmplusMathProgramTarget
  460. #define NormalPbmplusMathProgramTarget(program) \                           @@\
  461. NormalPbmplusProgramTarget(program)
  462. #endif /* NormalPbmplusMathProgramTarget */
  463. X
  464. #else
  465. X
  466. #ifndef NormalPbmplusProgramTarget
  467. #define NormalPbmplusProgramTarget(program) \                               @@\
  468. NormalProgramTarget(program,program.o,$(CURRENTDEPLIBS),$(CURRENTLIBS),)
  469. #endif /* NormalPbmplusProgramTarget */
  470. X
  471. #ifndef NormalPbmplusMathProgramTarget
  472. #define NormalPbmplusMathProgramTarget(program)                             @@\
  473. NormalProgramTarget(program,program.o,$(CURRENTDEPLIBS),$(CURRENTLIBS),-lm)
  474. #endif /* NormalPbmplusMathProgramTarget */
  475. X
  476. #ifndef InstallPbmplusPrograms
  477. #define InstallPbmplusPrograms(list,dest,flags)                             @@\
  478. install:: list                                                              @@\
  479. X    MakeDir($(DESTDIR)dest)                                             @@\
  480. X    @case '${MFLAGS}' in *[i]*) set +e;; esac; \                        @@\
  481. X    for i in list; do \                                                 @@\
  482. X        (set -x; $(RM) $(DESTDIR)dest/$$i; \                        @@\
  483. X        $(INSTALL) -c flags $$i $(DESTDIR)dest); \                  @@\
  484. X    done
  485. #endif /* InstallPbmplusPrograms */
  486. X
  487. #endif /* InstallMerged */
  488. SHAR_EOF
  489. chmod 0664 Pbmplus.tmpl ||
  490. echo 'restore of Pbmplus.tmpl failed'
  491. Wc_c="`wc -c < 'Pbmplus.tmpl'`"
  492. test 6893 -eq "$Wc_c" ||
  493.     echo 'Pbmplus.tmpl: original size 6893, current size' "$Wc_c"
  494. rm -f _shar_wnt_.tmp
  495. fi
  496. # ============= p121091.diffs ==============
  497. if test -f 'p121091.diffs' -a X"$1" != X"-c"; then
  498.     echo 'x - skipping p121091.diffs (File already exists)'
  499.     rm -f _shar_wnt_.tmp
  500. else
  501. > _shar_wnt_.tmp
  502. echo 'x - extracting p121091.diffs (Text)'
  503. sed 's/^X//' << 'SHAR_EOF' > 'p121091.diffs' &&
  504. diff -cr pbmplus30oct91/CHANGES CHANGES
  505. *** pbmplus30oct91/CHANGES    Wed Oct 30 13:03:49 1991
  506. --- CHANGES    Tue Dec 10 16:53:20 1991
  507. ***************
  508. *** 1,3 ****
  509. --- 1,21 ----
  510. + Changes since the 30oct91 patch version:
  511. +     Fixed uninitialized variable in ppmtotga.  (John Walker)
  512. +     Added pgmcrater, ppmforge, ppmtoacad, sldtoppm.  (John Walker)
  513. +     Slight change to the p?mmerge.c front-ends to allow for main programs
  514. +       that return instead of exitting.
  515. +     Minor clarifications to the pnmconvol man page.
  516. +     Fixed xwdtopnm to read some 16-bit True/Direct files. (David Elliott)
  517. +     Fixed uninitialized variables in pnmtotiff.  (Larry Rosenstein, Bayles Holt)
  518. +     Added a couple of checks for \r while reading whitespace. (Larry Rosenstein)
  519. +     Removed all the BROKENPUTC stuff.  Now we ignore all return values from
  520. +       putc(), and check ferror() in pm_close().  Added pm_close() calls to
  521. +       many of the filters.
  522. +     Fixed pnmdepth to check for too-large newmaxvals.  Improved rounding
  523. +       in pnmdepth and PPM_DEPTH macro.  (Tom Lane)
  524. +     Minor fix to ppmtouil.  (Mohsen Banan)
  525. +     Added new Imakefiles.  (Rainer Klute)
  526. X  Changes since the 05oct91 X11R5 contrib tape version:
  527. X  
  528. X      Fixed minor SysV config error in pbmplus.h.  (Tom Lane)
  529. diff -cr pbmplus30oct91/FORMATS FORMATS
  530. *** pbmplus30oct91/FORMATS    Fri Sep 27 01:43:23 1991
  531. --- FORMATS    Tue Dec 10 16:53:22 1991
  532. ***************
  533. *** 51,56 ****
  534. --- 51,58 ----
  535. X      X11 "puzzle" file                    writing
  536. X      Motif UIL icon file                    writing
  537. X      DEC sixel format                    writing
  538. +     AutoCAD slide format            reading    writing
  539. +     AutoCAD DXB format                    writing
  540. X  
  541. X  PNM handles the following multi-type formats:
  542. X  
  543. diff -cr pbmplus30oct91/Makefile Makefile
  544. *** pbmplus30oct91/Makefile    Wed Oct 30 20:13:49 1991
  545. --- Makefile    Tue Dec 10 16:53:27 1991
  546. ***************
  547. *** 50,55 ****
  548. --- 50,58 ----
  549. X  # Libtiff is pretty good about portability, but there are some machines
  550. X  # it has problems on.  If you run into problems, you may wish to contact
  551. X  # Sam directly, at the address listed in the OTHER.SYSTEMS file.
  552. + #
  553. + # By the way, you must have at least version 2.4 of libtiff.  Earlier
  554. + # versions will not work.
  555. X  TIFFDEF =    -DLIBTIFF
  556. X  TIFFINC =    -I../libtiff
  557. X  TIFFLIB =    ../libtiff/libtiff.a
  558. diff -cr pbmplus30oct91/OTHER.SYSTEMS OTHER.SYSTEMS
  559. *** pbmplus30oct91/OTHER.SYSTEMS    Wed Sep 18 20:03:52 1991
  560. --- OTHER.SYSTEMS    Tue Dec 10 16:53:22 1991
  561. ***************
  562. *** 62,67 ****
  563. --- 62,77 ----
  564. X      signal processing routines, and 2D/3D plotting packages.  Available via
  565. X      FTP as pprg.unm.edu:pub/khoros/*.
  566. X  
  567. +     LaboImage, a SunView-based image processing and analysis package.  It
  568. +     includes more than 200 image manipulation, processing and measurement
  569. +     routines, on-line help, plus tools such as an image editor, a color
  570. +     table editor and several biomedical utilities.  Available via anonymous
  571. +     FTP as ads.com:pub/VISION-LIST-ARCHIVE/SHAREWARE/LaboImage_3.1.tar.Z
  572. +     The San Diego Supercomputer Center Image Tools, software tools for
  573. +     reading, writing, and manipulating raster images.  Binaries for some
  574. +     machines available via anonymous FTP in sdsc.edu:sdscpub.
  575. X  Don't forget to set binary mode when you FTP tar files.  For you MILNET
  576. X  folks who still don't have name servers, the IP addresses are:
  577. X  
  578. ***************
  579. *** 74,79 ****
  580. --- 84,91 ----
  581. X      weedeater.math.yale.edu    130.132.23.17
  582. X      freebie.engin.umich.edu    141.212.68.23
  583. X      pprg.eece.unm.edu        129.24.24.10
  584. +     ads.com            128.229.30.16
  585. +     sdsc.edu            132.249.20.22
  586. X  
  587. X  Also, the newsgroup alt.graphics.pixutils is specifically for discussion
  588. X  of software like this.  You may find useful information there.
  589. diff -cr pbmplus30oct91/README README
  590. *** pbmplus30oct91/README    Wed Oct 30 20:11:16 1991
  591. --- README    Tue Dec 10 16:53:18 1991
  592. ***************
  593. *** 1,6 ****
  594. X                    Extended Portable Bitmap Toolkit
  595. !                       Distribution of 30oct91
  596. !                    Previous distribution 05oct91
  597. X  
  598. X  
  599. X  PBMPLUS is a toolkit for converting various image formats to and from
  600. --- 1,6 ----
  601. X                    Extended Portable Bitmap Toolkit
  602. !                       Distribution of 10dec91
  603. !                    Previous distribution 30oct91
  604. X  
  605. X  
  606. X  PBMPLUS is a toolkit for converting various image formats to and from
  607. ***************
  608. *** 40,49 ****
  609. X      Make.
  610. X      When you're happy that things compiled ok, make install.
  611. X      
  612. !     The Imakefiles are pretty minimal, but if you want to use them anyway:
  613. X  
  614. !     Edit pbmplus.h, find each line with the string "CONFIGURE", and
  615. !       follow the directions for setting configuration options.
  616. X      Save the original Makefiles, in case you later want to switch back
  617. X        to using them.
  618. X      The usual X11 sequence of xmkmf, make Makefiles, make depend, then
  619. --- 40,50 ----
  620. X      Make.
  621. X      When you're happy that things compiled ok, make install.
  622. X      
  623. !     If you want to use Imakefiles:
  624. X  
  625. !     Edit Pbmplus.tmpl, find each line with the string "CONFIGURE",
  626. !       and follow the directions for setting configuration options.
  627. !     Likewise edit pbmplus.h.
  628. X      Save the original Makefiles, in case you later want to switch back
  629. X        to using them.
  630. X      The usual X11 sequence of xmkmf, make Makefiles, make depend, then
  631. ***************
  632. *** 65,71 ****
  633. X  enhancements, etc. to this address:
  634. X  
  635. X      jef@well.sf.ca.us
  636. !     {apple, ucbvax}!well!jef
  637. X  
  638. X  When sending bug reports, always include the output from running any
  639. X  PBMPLUS program with the -version flag.  Also include the type of
  640. --- 66,72 ----
  641. X  enhancements, etc. to this address:
  642. X  
  643. X      jef@well.sf.ca.us
  644. !     apple!well!jef
  645. X  
  646. X  When sending bug reports, always include the output from running any
  647. X  PBMPLUS program with the -version flag.  Also include the type of
  648. ***************
  649. *** 135,140 ****
  650. --- 136,143 ----
  651. X      OTHER.SYSTEMS    list of other free image-processing software
  652. X      Makefile        guess
  653. X      Imakefile        for X11-type installations
  654. +     Imakefile.tiff    for X11-type installations
  655. +     Pbmplus.tmpl    for X11-type installations
  656. X      pbmplus.h        header file for PBM, PGM, PPM, and PNM
  657. X  
  658. X      compat.csh        csh script for compatibility with old versions
  659. ***************
  660. *** 216,221 ****
  661. --- 219,225 ----
  662. X      pgmtopbm.c        convert portable graymap to portable bitmap
  663. X  
  664. X      pgmbentley.c    Bentleyize a portable graymap
  665. +     pgmcrater.c        create cratered terrain by fractal forgery
  666. X      pgmedge.c        edge-detect a portable graymap
  667. X      pgmenhance.c    edge-enhance a portable graymap
  668. X      pgmhist.c        print a histogram of the values in a portable graymap
  669. ***************
  670. *** 251,256 ****
  671. --- 255,261 ----
  672. X      qrttoppm.c        convert QRT ray-tracer output to portable pixmap
  673. X      rawtoppm.c        convert raw RGB bytes to portable pixmap
  674. X      rgb3toppm.c        combine three portable graymaps into one portable pixmap
  675. +     sldtoppm.c        convert an AutoCAD slide file into a portable pixmap
  676. X      spctoppm.c        convert Atari compressed Spectrum to portable pixmap
  677. X      sputoppm.c        convert Atari uncompressed Spectrum to portable pixmap
  678. X      tgatoppm.c        convert TrueVision Targa file to portable pixmap
  679. ***************
  680. *** 258,263 ****
  681. --- 263,269 ----
  682. X      xpmtoppm.c        convert XPM format to portable pixmap
  683. X      yuvtoppm.c        convert Abekas YUV format to portable pixmap
  684. X  
  685. +     ppmtoacad.c        convert portable pixmap to AutoCAD database or slide
  686. X      ppmtogif.c        convert portable pixmap to GIF
  687. X      ppmtoicr.c        convert portable pixmap to NCSA ICR graphics
  688. X      ppmtoilbm.c        convert portable pixmap to IFF ILBM
  689. ***************
  690. *** 275,281 ****
  691. --- 281,289 ----
  692. X      ppmtoyuv.c        convert portable pixmap to Abekas YUV format
  693. X  
  694. X      ppmdither.c        ordered dither for color images
  695. +     ppmforge.c        fractal forgeries of clouds, planets, and starry skies
  696. X      ppmhist.c        print a histogram of a portable pixmap
  697. +     ppmmake.c        create a pixmap of a specified size and color
  698. X      ppmpat.c        create a pretty pixmap
  699. X      ppmquant.c        quantize colors down to a specified number
  700. X      ppmquantall        script to run ppmquant on a set of pixmaps
  701. ***************
  702. *** 287,292 ****
  703. --- 295,301 ----
  704. X      ppmcmap.h        header file for colormap routines in libppm
  705. X      ppmdraw.h        header file for simple drawing routines in libppm
  706. X      libppm.h        internal header file for libppm
  707. +     autocad.h        definitions for AutoCAD files
  708. X      tga.h        definitions for TrueVision Targa files
  709. X      xim.h        definitions for Xim files
  710. X      *.1            manual entries for all of the tools
  711. diff -cr pbmplus30oct91/pbmplus.h pbmplus.h
  712. *** pbmplus30oct91/pbmplus.h    Sun Oct  6 09:32:33 1991
  713. --- pbmplus.h    Tue Dec 10 16:53:28 1991
  714. ***************
  715. *** 17,27 ****
  716. X  #include <ctype.h>
  717. X  #include <stdio.h>
  718. X  
  719. ! #if ! ( defined(BSD) || defined(SYSV) || defined(MSDOS))
  720. X  /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a
  721. X  ** System V site, set the SYSV option; and if you're IBM-compatible, set
  722. X  ** MSDOS.  If your compiler is ANSI C, you're probably better off setting
  723. ! ** SYSV.
  724. X  */
  725. X  #define BSD
  726. X  /* #define SYSV */
  727. --- 17,30 ----
  728. X  #include <ctype.h>
  729. X  #include <stdio.h>
  730. X  
  731. ! #if defined(USG) || defined(SVR4)
  732. ! #define SYSV
  733. ! #endif
  734. ! #if ! ( defined(BSD) || defined(SYSV) || defined(MSDOS) )
  735. X  /* CONFIGURE: If your system is >= 4.2BSD, set the BSD option; if you're a
  736. X  ** System V site, set the SYSV option; and if you're IBM-compatible, set
  737. X  ** MSDOS.  If your compiler is ANSI C, you're probably better off setting
  738. ! ** SYSV - all it affects is string handling.
  739. X  */
  740. X  #define BSD
  741. X  /* #define SYSV */
  742. ***************
  743. *** 36,62 ****
  744. X  ** Note that reading "raw" files works whether writing is enabled or not.
  745. X  */
  746. X  #define PBMPLUS_RAWBITS
  747. - /* CONFIGURE: On some systems, the putc() macro is broken and will return
  748. - ** EOF when you write out a 255.  For example, ULTRIX does this.  This
  749. - ** only matters if you have defined RAWBITS.  To test whether your system
  750. - ** is broken this way, go ahead and compile things with RAWBITS defined,
  751. - ** and then try "pbmmake -b 8 1 > file".  If it works, fine.  If not,
  752. - ** define BROKENPUTC1 and try again - if that works, good.  Otherwise,
  753. - ** BROKENPUTC2 is guaranteed to work, although it's about twice as slow.
  754. - */
  755. - /* #define PBMPLUS_BROKENPUTC1 */
  756. - /* #define PBMPLUS_BROKENPUTC2 */
  757. - #ifdef PBMPLUS_BROKENPUTC1
  758. - #undef putc
  759. - /* This is a fixed version of putc() that should work on most Unix systems. */
  760. - #define putc(x,p) (--(p)->_cnt>=0? ((int)(unsigned char)(*(p)->_ptr++=(unsigned char)(x))) : _flsbuf((unsigned char)(x),p))
  761. - #endif /*PBMPLUS_BROKENPUTC1*/
  762. - #ifdef PBMPLUS_BROKENPUTC2
  763. - #undef putc
  764. - /* For this one, putc() becomes a function, defined in pbm/libpbm1.c. */
  765. - #endif /*PBMPLUS_BROKENPUTC2*/
  766. X  
  767. X  /* CONFIGURE: PGM can store gray values as either bytes or shorts.  For most
  768. X  ** applications, bytes will be big enough, and the memory savings can be
  769. --- 39,44 ----
  770. diff -cr pbmplus30oct91/version.h version.h
  771. *** pbmplus30oct91/version.h    Wed Oct 30 20:11:25 1991
  772. --- version.h    Tue Dec 10 16:53:28 1991
  773. ***************
  774. *** 1,4 ****
  775. X  /* version.h - define the current version of PBM, PGM, PPM, and PNM
  776. X  */
  777. X  
  778. ! #define PBMPLUS_VERSION "30oct91"
  779. --- 1,4 ----
  780. X  /* version.h - define the current version of PBM, PGM, PPM, and PNM
  781. X  */
  782. X  
  783. ! #define PBMPLUS_VERSION "10dec91"
  784. diff -cr pbmplus30oct91/pbm/Makefile pbm/Makefile
  785. *** pbmplus30oct91/pbm/Makefile    Thu Oct 24 13:34:36 1991
  786. --- pbm/Makefile    Tue Dec 10 16:51:57 1991
  787. ***************
  788. *** 42,49 ****
  789. X          pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \
  790. X          pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \
  791. X          pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \
  792. !         pbmupc pi3topbm xbmtopbm \
  793. !         ybmtopbm
  794. X  
  795. X  OBJECTS =    atktopbm.o brushtopbm.o cmuwmtopbm.o g3topbm.o \
  796. X          icontopbm.o gemtopbm.o macptopbm.o mgrtopbm.o \
  797. --- 42,48 ----
  798. X          pbmtogem pbmtogo pbmtoicon pbmtolj pbmtomacp \
  799. X          pbmtomgr pbmtopi3 pbmtoplot pbmtoptx \
  800. X          pbmtox10bm pbmtoxbm pbmtoybm pbmtozinc \
  801. !         pbmupc pi3topbm xbmtopbm ybmtopbm
  802. X  
  803. X  OBJECTS =    atktopbm.o brushtopbm.o cmuwmtopbm.o g3topbm.o \
  804. X          icontopbm.o gemtopbm.o macptopbm.o mgrtopbm.o \
  805. ***************
  806. *** 53,60 ****
  807. X          pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \
  808. X          pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \
  809. X          pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \
  810. !         pbmupc.o pi3topbm.o xbmtopbm.o \
  811. !         ybmtopbm.o
  812. X  
  813. X  MANUALS1 =    $(BINARIES)
  814. X  MANUALS3 =    libpbm
  815. --- 52,58 ----
  816. X          pbmtogem.o pbmtogo.o pbmtoicon.o pbmtolj.o pbmtomacp.o \
  817. X          pbmtomgr.o pbmtopi3.o pbmtoplot.o pbmtoptx.o \
  818. X          pbmtox10bm.o pbmtoxbm.o pbmtoybm.o pbmtozinc.o \
  819. !         pbmupc.o pi3topbm.o xbmtopbm.o ybmtopbm.o
  820. X  
  821. X  MANUALS1 =    $(BINARIES)
  822. X  MANUALS3 =    libpbm
  823. diff -cr pbmplus30oct91/pbm/atktopbm.c pbm/atktopbm.c
  824. *** pbmplus30oct91/pbm/atktopbm.c    Thu Sep 26 18:55:48 1991
  825. --- pbm/atktopbm.c    Tue Dec 10 16:53:16 1991
  826. ***************
  827. *** 21,27 ****
  828. X      int argc;
  829. X      char *argv[];
  830. X      {
  831. !     FILE *ifd;
  832. X      register bit *bitrow, *bP;
  833. X      int rows, cols, row, col, charcount;
  834. X      unsigned char *data, mask;
  835. --- 21,27 ----
  836. X      int argc;
  837. X      char *argv[];
  838. X      {
  839. !     FILE *ifp;
  840. X      register bit *bitrow, *bP;
  841. X      int rows, cols, row, col, charcount;
  842. X      unsigned char *data, mask;
  843. ***************
  844. *** 32,44 ****
  845. X      pm_usage( "[raster obj]" );
  846. X      
  847. X      if ( argc == 2 )
  848. !     ifd = pm_openr( argv[1] );
  849. X      else
  850. !     ifd = stdin;
  851. X  
  852. !     ReadATKRaster( ifd, &cols, &rows, &data );
  853. X  
  854. !     pm_close( ifd );
  855. X  
  856. X      pbm_writepbminit( stdout, cols, rows, 0 );
  857. X      bitrow = pbm_allocrow( cols );
  858. --- 32,44 ----
  859. X      pm_usage( "[raster obj]" );
  860. X      
  861. X      if ( argc == 2 )
  862. !     ifp = pm_openr( argv[1] );
  863. X      else
  864. !     ifp = stdin;
  865. X  
  866. !     ReadATKRaster( ifp, &cols, &rows, &data );
  867. X  
  868. !     pm_close( ifp );
  869. X  
  870. X      pbm_writepbminit( stdout, cols, rows, 0 );
  871. X      bitrow = pbm_allocrow( cols );
  872. ***************
  873. *** 63,68 ****
  874. --- 63,69 ----
  875. X      pbm_writepbmrow( stdout, bitrow, cols, 0 );
  876. X      }
  877. X  
  878. +     pm_close( stdout );
  879. X      exit( 0 );
  880. X      }
  881. X  
  882. diff -cr pbmplus30oct91/pbm/brushtopbm.c pbm/brushtopbm.c
  883. *** pbmplus30oct91/pbm/brushtopbm.c    Fri Jun 28 14:28:18 1991
  884. --- pbm/brushtopbm.c    Tue Dec 10 16:52:20 1991
  885. ***************
  886. *** 56,61 ****
  887. --- 56,62 ----
  888. X      }
  889. X  
  890. X      pm_close( ifp );
  891. +     pm_close( stdout );
  892. X      
  893. X      exit( 0 );
  894. X      }
  895. diff -cr pbmplus30oct91/pbm/cmuwmtopbm.c pbm/cmuwmtopbm.c
  896. *** pbmplus30oct91/pbm/cmuwmtopbm.c    Fri Jun 28 14:42:04 1991
  897. --- pbm/cmuwmtopbm.c    Tue Dec 10 16:52:36 1991
  898. ***************
  899. *** 58,63 ****
  900. --- 58,64 ----
  901. X      }
  902. X  
  903. X      pm_close( ifp );
  904. +     pm_close( stdout );
  905. X  
  906. X      exit( 0 );
  907. X      }
  908. diff -cr pbmplus30oct91/pbm/g3topbm.c pbm/g3topbm.c
  909. *** pbmplus30oct91/pbm/g3topbm.c    Fri Jun 28 14:51:31 1991
  910. --- pbm/g3topbm.c    Tue Dec 10 16:52:11 1991
  911. ***************
  912. *** 123,128 ****
  913. --- 123,129 ----
  914. X      pbm_writepbminit( stdout, cols, rows, 0 );
  915. X      for ( row = 0; row < rows; ++row )
  916. X      pbm_writepbmrow( stdout, bits[row], cols, 0 );
  917. +     pm_close( stdout );
  918. X  
  919. X      exit(0);
  920. X      }
  921. diff -cr pbmplus30oct91/pbm/gemtopbm.c pbm/gemtopbm.c
  922. *** pbmplus30oct91/pbm/gemtopbm.c    Fri Jun 28 14:42:07 1991
  923. --- pbm/gemtopbm.c    Tue Dec 10 16:52:30 1991
  924. ***************
  925. *** 209,214 ****
  926. --- 209,215 ----
  927. X          } while (linerep--);
  928. X      }
  929. X      pm_close( f );
  930. +     pm_close( stdout );
  931. X      exit(0);
  932. X  }
  933. X  
  934. diff -cr pbmplus30oct91/pbm/icontopbm.c pbm/icontopbm.c
  935. *** pbmplus30oct91/pbm/icontopbm.c    Fri Jun 28 14:28:25 1991
  936. --- pbm/icontopbm.c    Tue Dec 10 16:51:58 1991
  937. ***************
  938. *** 62,67 ****
  939. --- 62,68 ----
  940. X      pbm_writepbmrow( stdout, bitrow, cols, 0 );
  941. X      }
  942. X  
  943. +     pm_close( stdout );
  944. X      exit( 0 );
  945. X      }
  946. X  
  947. diff -cr pbmplus30oct91/pbm/libpbm1.c pbm/libpbm1.c
  948. *** pbmplus30oct91/pbm/libpbm1.c    Wed Jul  3 13:08:09 1991
  949. --- pbm/libpbm1.c    Tue Dec 10 16:52:45 1991
  950. ***************
  951. *** 376,382 ****
  952. X      {
  953. X      if ( *format != '%' )
  954. X          { /* Not special, just write out the char. */
  955. !         putc( *format, stream );
  956. X          ++n;
  957. X          ++format;
  958. X          }
  959. --- 376,382 ----
  960. X      {
  961. X      if ( *format != '%' )
  962. X          { /* Not special, just write out the char. */
  963. !         (void) putc( *format, stream );
  964. X          ++n;
  965. X          ++format;
  966. X          }
  967. ***************
  968. *** 467,473 ****
  969. X          break;
  970. X  
  971. X              case '%':
  972. !         putc( '%', stream );
  973. X          ++n;
  974. X          break;
  975. X  
  976. --- 467,473 ----
  977. X          break;
  978. X  
  979. X              case '%':
  980. !         (void) putc( '%', stream );
  981. X          ++n;
  982. X          break;
  983. X  
  984. ***************
  985. *** 533,555 ****
  986. X  pm_close( f )
  987. X      FILE* f;
  988. X      {
  989. X      if ( f != stdin )
  990. X      if ( fclose( f ) != 0 )
  991. X          pm_perror( "fclose" );
  992. X      }
  993. X  
  994. - /* Broken putc() fix. */
  995. - #ifdef PBMPLUS_BROKENPUTC2
  996. - int
  997. - putc( c, stream )
  998. -     char c;
  999. -     FILE* stream;
  1000. -     {
  1001. -     return fwrite( &c, 1, 1, stream ) == 1 ? c : EOF;
  1002. -     }
  1003. - #endif /*PBMPLUS_BROKENPUTC2*/
  1004. X  /* Endian I/O.
  1005. X  */
  1006. X  
  1007. --- 533,546 ----
  1008. X  pm_close( f )
  1009. X      FILE* f;
  1010. X      {
  1011. +     fflush( f );
  1012. +     if ( ferror( f ) )
  1013. +     pm_message( "a file read or write error occurred at some point" );
  1014. X      if ( f != stdin )
  1015. X      if ( fclose( f ) != 0 )
  1016. X          pm_perror( "fclose" );
  1017. X      }
  1018. X  
  1019. X  /* Endian I/O.
  1020. X  */
  1021. X  
  1022. ***************
  1023. *** 579,588 ****
  1024. X      short s;
  1025. X  #endif /*__STDC__*/
  1026. X      {
  1027. !     if ( putc( ( s >> 8 ) & 0xff, out ) == EOF )
  1028. !     return -1;
  1029. !     if ( putc( s & 0xff, out ) == EOF )
  1030. !     return -1;
  1031. X      return 0;
  1032. X      }
  1033. X  
  1034. --- 570,577 ----
  1035. X      short s;
  1036. X  #endif /*__STDC__*/
  1037. X      {
  1038. !     (void) putc( ( s >> 8 ) & 0xff, out );
  1039. !     (void) putc( s & 0xff, out );
  1040. X      return 0;
  1041. X      }
  1042. X  
  1043. ***************
  1044. *** 613,626 ****
  1045. X      FILE* out;
  1046. X      long l;
  1047. X      {
  1048. !     if ( putc( ( l >> 24 ) & 0xff, out ) == EOF )
  1049. !     return -1;
  1050. !     if ( putc( ( l >> 16 ) & 0xff, out ) == EOF )
  1051. !     return -1;
  1052. !     if ( putc( ( l >> 8 ) & 0xff, out ) == EOF )
  1053. !     return -1;
  1054. !     if ( putc( l & 0xff, out ) == EOF )
  1055. !     return -1;
  1056. X      return 0;
  1057. X      }
  1058. X  
  1059. --- 602,611 ----
  1060. X      FILE* out;
  1061. X      long l;
  1062. X      {
  1063. !     (void) putc( ( l >> 24 ) & 0xff, out );
  1064. !     (void) putc( ( l >> 16 ) & 0xff, out );
  1065. !     (void) putc( ( l >> 8 ) & 0xff, out );
  1066. !     (void) putc( l & 0xff, out );
  1067. X      return 0;
  1068. X      }
  1069. X  
  1070. ***************
  1071. *** 650,659 ****
  1072. X      short s;
  1073. X  #endif /*__STDC__*/
  1074. X      {
  1075. !     if ( putc( s & 0xff, out ) == EOF )
  1076. !     return -1;
  1077. !     if ( putc( ( s >> 8 ) & 0xff, out ) == EOF )
  1078. !     return -1;
  1079. X      return 0;
  1080. X      }
  1081. X  
  1082. --- 635,642 ----
  1083. X      short s;
  1084. X  #endif /*__STDC__*/
  1085. X      {
  1086. !     (void) putc( s & 0xff, out );
  1087. !     (void) putc( ( s >> 8 ) & 0xff, out );
  1088. X      return 0;
  1089. X      }
  1090. X  
  1091. ***************
  1092. *** 684,696 ****
  1093. X      FILE* out;
  1094. X      long l;
  1095. X      {
  1096. !     if ( putc( l & 0xff, out ) == EOF )
  1097. !     return -1;
  1098. !     if ( putc( ( l >> 8 ) & 0xff, out ) == EOF )
  1099. !     return -1;
  1100. !     if ( putc( ( l >> 16 ) & 0xff, out ) == EOF )
  1101. !     return -1;
  1102. !     if ( putc( ( l >> 24 ) & 0xff, out ) == EOF )
  1103. !     return -1;
  1104. X      return 0;
  1105. X      }
  1106. --- 667,675 ----
  1107. X      FILE* out;
  1108. X      long l;
  1109. X      {
  1110. !     (void) putc( l & 0xff, out );
  1111. !     (void) putc( ( l >> 8 ) & 0xff, out );
  1112. !     (void) putc( ( l >> 16 ) & 0xff, out );
  1113. !     (void) putc( ( l >> 24 ) & 0xff, out );
  1114. X      return 0;
  1115. X      }
  1116. diff -cr pbmplus30oct91/pbm/libpbm3.c pbm/libpbm3.c
  1117. *** pbmplus30oct91/pbm/libpbm3.c    Fri Jun 28 14:28:29 1991
  1118. --- pbm/libpbm3.c    Tue Dec 10 16:52:47 1991
  1119. ***************
  1120. *** 49,63 ****
  1121. X      --bitshift;
  1122. X      if ( bitshift == -1 )
  1123. X          {
  1124. !         if ( putc( item, file ) == EOF )
  1125. !         pm_error( "write error" );
  1126. X          bitshift = 7;
  1127. X          item = 0;
  1128. X          }
  1129. X      }
  1130. X      if ( bitshift != 7 )
  1131. !     if ( putc( item, file ) == EOF )
  1132. !         pm_error( "write error" );
  1133. X      }
  1134. X  #endif /*PBMPLUS_RAWBITS*/
  1135. X  
  1136. --- 49,61 ----
  1137. X      --bitshift;
  1138. X      if ( bitshift == -1 )
  1139. X          {
  1140. !         (void) putc( item, file );
  1141. X          bitshift = 7;
  1142. X          item = 0;
  1143. X          }
  1144. X      }
  1145. X      if ( bitshift != 7 )
  1146. !     (void) putc( item, file );
  1147. X      }
  1148. X  #endif /*PBMPLUS_RAWBITS*/
  1149. X  
  1150. ***************
  1151. *** 75,90 ****
  1152. X      {
  1153. X      if ( charcount >= 70 )
  1154. X          {
  1155. !         if ( putc( '\n', file ) == EOF )
  1156. !         pm_error( "write error" );
  1157. X          charcount = 0;
  1158. X          }
  1159. !     if ( putc( *bP ? '1' : '0', file ) == EOF )
  1160. !         pm_error( "write error" );
  1161. X      ++charcount;
  1162. X      }
  1163. !     if ( putc( '\n', file ) == EOF )
  1164. !     pm_error( "write error" );
  1165. X      }
  1166. X  
  1167. X  void
  1168. --- 73,85 ----
  1169. X      {
  1170. X      if ( charcount >= 70 )
  1171. X          {
  1172. !         (void) putc( '\n', file );
  1173. X          charcount = 0;
  1174. X          }
  1175. !     (void) putc( *bP ? '1' : '0', file );
  1176. X      ++charcount;
  1177. X      }
  1178. !     (void) putc( '\n', file );
  1179. X      }
  1180. X  
  1181. X  void
  1182. diff -cr pbmplus30oct91/pbm/libpbm4.c pbm/libpbm4.c
  1183. *** pbmplus30oct91/pbm/libpbm4.c    Fri Jun 28 14:28:31 1991
  1184. --- pbm/libpbm4.c    Tue Dec 10 16:52:47 1991
  1185. ***************
  1186. *** 34,40 ****
  1187. X          pm_error( "EOF / read error" );
  1188. X          ch = (char) ich;
  1189. X          }
  1190. !     while ( ch != '\n' );
  1191. X      }
  1192. X  
  1193. X      return ch;
  1194. --- 34,40 ----
  1195. X          pm_error( "EOF / read error" );
  1196. X          ch = (char) ich;
  1197. X          }
  1198. !     while ( ch != '\n' && ch != '\r' );
  1199. X      }
  1200. X  
  1201. X      return ch;
  1202. ***************
  1203. *** 63,69 ****
  1204. X      {
  1205. X      ch = pbm_getc( file );
  1206. X      }
  1207. !     while ( ch == ' ' || ch == '\t' || ch == '\n' );
  1208. X  
  1209. X      if ( ch < '0' || ch > '9' )
  1210. X      pm_error( "junk in file where an integer should be" );
  1211. --- 63,69 ----
  1212. X      {
  1213. X      ch = pbm_getc( file );
  1214. X      }
  1215. !     while ( ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' );
  1216. X  
  1217. X      if ( ch < '0' || ch > '9' )
  1218. X      pm_error( "junk in file where an integer should be" );
  1219. diff -cr pbmplus30oct91/pbm/macptopbm.c pbm/macptopbm.c
  1220. *** pbmplus30oct91/pbm/macptopbm.c    Fri Jun 28 14:28:33 1991
  1221. --- pbm/macptopbm.c    Tue Dec 10 16:52:00 1991
  1222. ***************
  1223. *** 74,79 ****
  1224. --- 74,80 ----
  1225. X      pbm_writepbmrow( stdout, bitrow, cols, 0 );
  1226. X      }
  1227. X  
  1228. +     pm_close( stdout );
  1229. X      exit( 0 );
  1230. X      }
  1231. X  
  1232. diff -cr pbmplus30oct91/pbm/mgrtopbm.c pbm/mgrtopbm.c
  1233. *** pbmplus30oct91/pbm/mgrtopbm.c    Fri Jun 28 14:42:09 1991
  1234. --- pbm/mgrtopbm.c    Tue Dec 10 16:52:22 1991
  1235. ***************
  1236. *** 55,60 ****
  1237. --- 55,61 ----
  1238. X      }
  1239. X  
  1240. X      pm_close( ifp );
  1241. +     pm_close( stdout );
  1242. X  
  1243. X      exit( 0 );
  1244. X      }
  1245. diff -cr pbmplus30oct91/pbm/pbmlife.c pbm/pbmlife.c
  1246. *** pbmplus30oct91/pbm/pbmlife.c    Fri Jun 28 14:28:35 1991
  1247. --- pbm/pbmlife.c    Tue Dec 10 16:52:34 1991
  1248. ***************
  1249. *** 107,112 ****
  1250. --- 107,113 ----
  1251. X      }
  1252. X  
  1253. X      pm_close( ifp );
  1254. +     pm_close( stdout );
  1255. X  
  1256. X      exit( 0 );
  1257. X      }
  1258. diff -cr pbmplus30oct91/pbm/pbmmake.c pbm/pbmmake.c
  1259. *** pbmplus30oct91/pbm/pbmmake.c    Fri Jun 28 14:28:36 1991
  1260. --- pbm/pbmmake.c    Tue Dec 10 16:52:13 1991
  1261. ***************
  1262. *** 79,83 ****
  1263. --- 79,84 ----
  1264. X      pbm_writepbmrow( stdout, bitrow, cols, 0 );
  1265. X      }
  1266. X  
  1267. +     pm_close( stdout );
  1268. X      exit( 0 );
  1269. X      }
  1270. diff -cr pbmplus30oct91/pbm/pbmmask.c pbm/pbmmask.c
  1271. *** pbmplus30oct91/pbm/pbmmask.c    Fri Jun 28 14:28:37 1991
  1272. --- pbm/pbmmask.c    Tue Dec 10 16:53:07 1991
  1273. ***************
  1274. *** 133,138 ****
  1275. --- 133,139 ----
  1276. X      pbm_writepbm( stdout, emask, cols, rows, 0 );
  1277. X      }
  1278. X  
  1279. +     pm_close( stdout );
  1280. X      exit( 0 );
  1281. X      }
  1282. X  
  1283. diff -cr pbmplus30oct91/pbm/pbmmerge.c pbm/pbmmerge.c
  1284. *** pbmplus30oct91/pbm/pbmmerge.c    Thu Sep 26 18:38:29 1991
  1285. --- pbm/pbmmerge.c    Tue Dec 10 16:52:54 1991
  1286. ***************
  1287. *** 32,38 ****
  1288. X      goto again;
  1289. X      }
  1290. X  
  1291. ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); }
  1292. X  
  1293. X      TRY( "atktopbm", atktopbm_main );
  1294. X      TRY( "brushtopbm", brushtopbm_main );
  1295. --- 32,38 ----
  1296. X      goto again;
  1297. X      }
  1298. X  
  1299. ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); }
  1300. X  
  1301. X      TRY( "atktopbm", atktopbm_main );
  1302. X      TRY( "brushtopbm", brushtopbm_main );
  1303. diff -cr pbmplus30oct91/pbm/pbmreduce.c pbm/pbmreduce.c
  1304. *** pbmplus30oct91/pbm/pbmreduce.c    Sun Jul  7 17:29:03 1991
  1305. --- pbm/pbmreduce.c    Tue Dec 10 16:52:28 1991
  1306. ***************
  1307. *** 193,198 ****
  1308. --- 193,199 ----
  1309. X      }
  1310. X  
  1311. X      pm_close( ifp );
  1312. +     pm_close( stdout );
  1313. X  
  1314. X      exit( 0 );
  1315. X      }
  1316. diff -cr pbmplus30oct91/pbm/pbmtext.c pbm/pbmtext.c
  1317. *** pbmplus30oct91/pbm/pbmtext.c    Fri Jun 28 14:28:43 1991
  1318. --- pbm/pbmtext.c    Tue Dec 10 16:52:39 1991
  1319. ***************
  1320. *** 152,157 ****
  1321. --- 152,158 ----
  1322. X  
  1323. X      /* All done. */
  1324. X      pbm_writepbm( stdout, bits, cols, rows, 0 );
  1325. +     pm_close( stdout );
  1326. X  
  1327. X      exit( 0 );
  1328. X      }
  1329. diff -cr pbmplus30oct91/pbm/pbmtocmuwm.c pbm/pbmtocmuwm.c
  1330. *** pbmplus30oct91/pbm/pbmtocmuwm.c    Fri Jun 28 14:28:47 1991
  1331. --- pbm/pbmtocmuwm.c    Tue Dec 10 16:52:37 1991
  1332. ***************
  1333. *** 109,116 ****
  1334. X  static void
  1335. X  putitem( )
  1336. X      {
  1337. !     if ( putc( item, stdout ) == EOF )
  1338. !     pm_error( "write error" );
  1339. X      item = 0;
  1340. X      bitsperitem = 0;
  1341. X      bitshift = 7;
  1342. --- 109,115 ----
  1343. X  static void
  1344. X  putitem( )
  1345. X      {
  1346. !     (void) putc( item, stdout );
  1347. X      item = 0;
  1348. X      bitsperitem = 0;
  1349. X      bitshift = 7;
  1350. diff -cr pbmplus30oct91/pbm/pbmtogem.c pbm/pbmtogem.c
  1351. *** pbmplus30oct91/pbm/pbmtogem.c    Fri Jun 28 14:28:51 1991
  1352. --- pbm/pbmtogem.c    Tue Dec 10 16:53:00 1991
  1353. ***************
  1354. *** 155,162 ****
  1355. X  static void
  1356. X  putrow( )
  1357. X      {
  1358. !     putc(0x80, stdout);        /* a Bit string */
  1359. !     putc(outcol*2, stdout);    /* count */
  1360. X      fwrite( outrow, outcol*2, 1, stdout );
  1361. X      outcol = 0;
  1362. X      }        
  1363. --- 155,162 ----
  1364. X  static void
  1365. X  putrow( )
  1366. X      {
  1367. !     (void) putc(0x80, stdout);        /* a Bit string */
  1368. !     (void) putc(outcol*2, stdout);    /* count */
  1369. X      fwrite( outrow, outcol*2, 1, stdout );
  1370. X      outcol = 0;
  1371. X      }        
  1372. diff -cr pbmplus30oct91/pbm/pbmtomacp.c pbm/pbmtomacp.c
  1373. *** pbmplus30oct91/pbm/pbmtomacp.c    Fri Jun 28 14:28:57 1991
  1374. --- pbm/pbmtomacp.c    Tue Dec 10 16:52:16 1991
  1375. ***************
  1376. *** 280,286 ****
  1377. X  
  1378. X    b = pb;
  1379. X    while( npb-- )
  1380. !     putc( *b++, fdout );
  1381. X  } /* sendbytes */
  1382. X  
  1383. X  /* - - - - - - - - - - - - - - - - - - - - - - - - - - */
  1384. --- 280,286 ----
  1385. X  
  1386. X    b = pb;
  1387. X    while( npb-- )
  1388. !     (void) putc( *b++, fdout );
  1389. X  } /* sendbytes */
  1390. X  
  1391. X  /* - - - - - - - - - - - - - - - - - - - - - - - - - - */
  1392. ***************
  1393. *** 293,297 ****
  1394. X    /* header contains nothing ... */
  1395. X    ch = '\0';
  1396. X    for(i = 0; i < HEADER_LENGTH; i++ )
  1397. !     putc( ch, fdout );
  1398. X  } /* header */
  1399. --- 293,297 ----
  1400. X    /* header contains nothing ... */
  1401. X    ch = '\0';
  1402. X    for(i = 0; i < HEADER_LENGTH; i++ )
  1403. !     (void) putc( ch, fdout );
  1404. X  } /* header */
  1405. diff -cr pbmplus30oct91/pbm/pbmupc.c pbm/pbmupc.c
  1406. *** pbmplus30oct91/pbm/pbmupc.c    Fri Jun 28 14:39:31 1991
  1407. --- pbm/pbmupc.c    Tue Dec 10 16:52:43 1991
  1408. ***************
  1409. *** 141,146 ****
  1410. --- 141,147 ----
  1411. X      putdigit( sum, bits, digrow, col + LINE1_WIDTH );
  1412. X  
  1413. X      pbm_writepbm( stdout, bits, cols, rows, 0 );
  1414. +     pm_close( stdout );
  1415. X  
  1416. X      exit( 0 );
  1417. X      }
  1418. diff -cr pbmplus30oct91/pbm/pi3topbm.c pbm/pi3topbm.c
  1419. *** pbmplus30oct91/pbm/pi3topbm.c    Fri Jun 28 14:29:09 1991
  1420. --- pbm/pi3topbm.c    Tue Dec 10 16:53:02 1991
  1421. ***************
  1422. *** 90,94 ****
  1423. --- 90,95 ----
  1424. X          pbm_writepbmrow( stdout, bitrow, cols, 0 );
  1425. X      }
  1426. X      pm_close( f );
  1427. +     pm_close( stdout );
  1428. X      exit(0);
  1429. X  }
  1430. diff -cr pbmplus30oct91/pbm/xbmtopbm.c pbm/xbmtopbm.c
  1431. *** pbmplus30oct91/pbm/xbmtopbm.c    Fri Jun 28 14:29:10 1991
  1432. --- pbm/xbmtopbm.c    Tue Dec 10 16:52:02 1991
  1433. ***************
  1434. *** 63,68 ****
  1435. --- 63,69 ----
  1436. X      pbm_writepbmrow( stdout, bitrow, cols, 0 );
  1437. X      }
  1438. X  
  1439. +     pm_close( stdout );
  1440. X      exit( 0 );
  1441. X      }
  1442. X  
  1443. diff -cr pbmplus30oct91/pbm/ybmtopbm.c pbm/ybmtopbm.c
  1444. *** pbmplus30oct91/pbm/ybmtopbm.c    Fri Jun 28 14:42:10 1991
  1445. --- pbm/ybmtopbm.c    Tue Dec 10 16:52:57 1991
  1446. ***************
  1447. *** 60,65 ****
  1448. --- 60,66 ----
  1449. X      }
  1450. X  
  1451. X      pm_close( ifp );
  1452. +     pm_close( stdout );
  1453. X  
  1454. X      exit( 0 );
  1455. X      }
  1456. diff -cr pbmplus30oct91/pgm/Makefile pgm/Makefile
  1457. *** pbmplus30oct91/pgm/Makefile    Fri Sep 27 12:33:43 1991
  1458. --- pgm/Makefile    Tue Dec 10 16:53:33 1991
  1459. ***************
  1460. *** 41,53 ****
  1461. X          pgmenhance pgmhist pgmnorm pgmoil pgmramp \
  1462. X          pgmtofits pgmtofs pgmtolispm pgmtopbm \
  1463. X          psidtopgm rawtopgm
  1464. ! MATHBINARIES =    pgmedge pgmtexture
  1465. X  BINARIES =    $(PORTBINARIES) $(MATHBINARIES)
  1466. X  
  1467. X  OBJECTS =    fitstopgm.o fstopgm.o hipstopgm.o lispmtopgm.o pgmbentley.o \
  1468. X          pgmenhance.o pgmhist.o pgmnorm.o pgmoil.o pgmramp.o \
  1469. X          pgmtofits.o pgmtofs.o pgmtolispm.o pgmtopbm.o \
  1470. !         psidtopgm.o rawtopgm.o pgmedge.o pgmtexture.o
  1471. X  
  1472. X  MANUALS1 =    $(BINARIES)
  1473. X  MANUALS3 =    libpgm
  1474. --- 41,53 ----
  1475. X          pgmenhance pgmhist pgmnorm pgmoil pgmramp \
  1476. X          pgmtofits pgmtofs pgmtolispm pgmtopbm \
  1477. X          psidtopgm rawtopgm
  1478. ! MATHBINARIES =    pgmcrater pgmedge pgmtexture
  1479. X  BINARIES =    $(PORTBINARIES) $(MATHBINARIES)
  1480. X  
  1481. X  OBJECTS =    fitstopgm.o fstopgm.o hipstopgm.o lispmtopgm.o pgmbentley.o \
  1482. X          pgmenhance.o pgmhist.o pgmnorm.o pgmoil.o pgmramp.o \
  1483. X          pgmtofits.o pgmtofs.o pgmtolispm.o pgmtopbm.o \
  1484. !         psidtopgm.o rawtopgm.o pgmcrater.o pgmedge.o pgmtexture.o
  1485. X  
  1486. X  MANUALS1 =    $(BINARIES)
  1487. X  MANUALS3 =    libpgm
  1488. ***************
  1489. *** 126,131 ****
  1490. --- 126,132 ----
  1491. X  hipstopgm hipstopgm.o:        hipstopgm.c
  1492. X  lispmtopgm lispmtopgm.o:    lispmtopgm.c
  1493. X  pgmbentley pgmbentley.o:    pgmbentley.c
  1494. + pgmcrater pgmcrater.o:        pgmcrater.c
  1495. X  pgmedge pgmedge.o:        pgmedge.c
  1496. X  pgmenhance pgmenhance.o:    pgmenhance.c
  1497. X  pgmhist pgmhist.o:        pgmhist.c
  1498. diff -cr pbmplus30oct91/pgm/fitstopgm.c pgm/fitstopgm.c
  1499. *** pbmplus30oct91/pgm/fitstopgm.c    Wed Sep 25 22:47:36 1991
  1500. --- pgm/fitstopgm.c    Tue Dec 10 16:53:53 1991
  1501. ***************
  1502. *** 186,191 ****
  1503. --- 186,192 ----
  1504. X          }
  1505. X      }
  1506. X      pm_close( ifp );
  1507. +     pm_close( stdout );
  1508. X  
  1509. X      exit( 0 );
  1510. X      }
  1511. diff -cr pbmplus30oct91/pgm/fstopgm.c pgm/fstopgm.c
  1512. *** pbmplus30oct91/pgm/fstopgm.c    Sat Jul  6 10:24:32 1991
  1513. --- pgm/fstopgm.c    Tue Dec 10 16:53:39 1991
  1514. ***************
  1515. *** 105,110 ****
  1516. --- 105,111 ----
  1517. X  
  1518. X      /* And write out the graymap. */
  1519. X      pgm_writepgm( stdout, grays, cols, rows, (gray) maxval, 0 );
  1520. +     pm_close( stdout );
  1521. X  
  1522. X      exit( 0 );
  1523. X      }
  1524. diff -cr pbmplus30oct91/pgm/hipstopgm.c pgm/hipstopgm.c
  1525. *** pbmplus30oct91/pgm/hipstopgm.c    Fri Jun 28 15:10:53 1991
  1526. --- pgm/hipstopgm.c    Tue Dec 10 16:53:41 1991
  1527. ***************
  1528. *** 115,120 ****
  1529. --- 115,121 ----
  1530. X      pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 );
  1531. X      }
  1532. X      pm_close( ifp );
  1533. +     pm_close( stdout );
  1534. X  
  1535. X      exit( 0 );
  1536. X      }
  1537. diff -cr pbmplus30oct91/pgm/libpgm2.c pgm/libpgm2.c
  1538. *** pbmplus30oct91/pgm/libpgm2.c    Fri Jun 28 14:29:17 1991
  1539. --- pgm/libpgm2.c    Tue Dec 10 16:53:37 1991
  1540. ***************
  1541. *** 41,55 ****
  1542. X  #endif /*PBMPLUS_RAWBITS*/
  1543. X      }
  1544. X  
  1545. ! static int
  1546. X  putus( n, file )
  1547. X      unsigned short n;
  1548. X      FILE* file;
  1549. X      {
  1550. X      if ( n >= 10 )
  1551. !     if ( putus( n / 10, file ) == EOF )
  1552. !         return EOF;
  1553. !     return putc( n % 10 + '0', file );
  1554. X      }
  1555. X  
  1556. X  #ifdef PBMPLUS_RAWBITS
  1557. --- 41,54 ----
  1558. X  #endif /*PBMPLUS_RAWBITS*/
  1559. X      }
  1560. X  
  1561. ! static void
  1562. X  putus( n, file )
  1563. X      unsigned short n;
  1564. X      FILE* file;
  1565. X      {
  1566. X      if ( n >= 10 )
  1567. !     putus( n / 10, file );
  1568. !     (void) putc( n % 10 + '0', file );
  1569. X      }
  1570. X  
  1571. X  #ifdef PBMPLUS_RAWBITS
  1572. ***************
  1573. *** 69,76 ****
  1574. X      if ( *gP > maxval )
  1575. X          pm_error( "value out of bounds (%u > %u)", *gP, maxval );
  1576. X  #endif /*DEBUG*/
  1577. !     if ( putc( *gP, file ) == EOF )
  1578. !         pm_error( "write error" );
  1579. X      }
  1580. X      }
  1581. X  #endif /*PBMPLUS_RAWBITS*/
  1582. --- 68,74 ----
  1583. X      if ( *gP > maxval )
  1584. X          pm_error( "value out of bounds (%u > %u)", *gP, maxval );
  1585. X  #endif /*DEBUG*/
  1586. !     (void) putc( *gP, file );
  1587. X      }
  1588. X      }
  1589. X  #endif /*PBMPLUS_RAWBITS*/
  1590. ***************
  1591. *** 90,103 ****
  1592. X      {
  1593. X      if ( charcount >= 65 )
  1594. X          {
  1595. !         if ( putc( '\n', file ) == EOF )
  1596. !         pm_error( "write error" );
  1597. X          charcount = 0;
  1598. X          }
  1599. X      else if ( charcount > 0 )
  1600. X          {
  1601. !         if ( putc( ' ', file ) == EOF )
  1602. !         pm_error( "write error" );
  1603. X          ++charcount;
  1604. X          }
  1605. X  #ifdef DEBUG
  1606. --- 88,99 ----
  1607. X      {
  1608. X      if ( charcount >= 65 )
  1609. X          {
  1610. !         (void) putc( '\n', file );
  1611. X          charcount = 0;
  1612. X          }
  1613. X      else if ( charcount > 0 )
  1614. X          {
  1615. !         (void) putc( ' ', file );
  1616. X          ++charcount;
  1617. X          }
  1618. X  #ifdef DEBUG
  1619. ***************
  1620. *** 104,116 ****
  1621. X      if ( *gP > maxval )
  1622. X          pm_error( "value out of bounds (%u > %u)", *gP, maxval );
  1623. X  #endif /*DEBUG*/
  1624. !     if ( putus( (unsigned long) *gP, file ) == EOF )
  1625. !         pm_error( "write error" );
  1626. X      charcount += 3;
  1627. X      }
  1628. X      if ( charcount > 0 )
  1629. !     if ( putc( '\n', file ) == EOF )
  1630. !         pm_error( "write error" );
  1631. X      }
  1632. X  
  1633. X  #if __STDC__
  1634. --- 100,110 ----
  1635. X      if ( *gP > maxval )
  1636. X          pm_error( "value out of bounds (%u > %u)", *gP, maxval );
  1637. X  #endif /*DEBUG*/
  1638. !     putus( (unsigned long) *gP, file );
  1639. X      charcount += 3;
  1640. X      }
  1641. X      if ( charcount > 0 )
  1642. !     (void) putc( '\n', file );
  1643. X      }
  1644. X  
  1645. X  #if __STDC__
  1646. diff -cr pbmplus30oct91/pgm/lispmtopgm.c pgm/lispmtopgm.c
  1647. *** pbmplus30oct91/pgm/lispmtopgm.c    Fri Jun 28 15:12:29 1991
  1648. --- pgm/lispmtopgm.c    Tue Dec 10 16:53:54 1991
  1649. ***************
  1650. *** 63,68 ****
  1651. --- 63,69 ----
  1652. X      pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 );
  1653. X      }
  1654. X      pm_close( ifp );
  1655. +     pm_close( stdout );
  1656. X      exit( 0 );
  1657. X      }
  1658. X  
  1659. diff -cr pbmplus30oct91/pgm/pgm.5 pgm/pgm.5
  1660. *** pbmplus30oct91/pgm/pgm.5    Thu Sep 26 16:13:49 1991
  1661. --- pgm/pgm.5    Tue Dec 10 16:53:34 1991
  1662. ***************
  1663. *** 1,4 ****
  1664. ! .TH pgm 5 "27 September 1991"
  1665. X  .SH NAME
  1666. X  pgm - portable graymap file format
  1667. X  .SH DESCRIPTION
  1668. --- 1,4 ----
  1669. ! .TH pgm 5 "12 November 1991"
  1670. X  .SH NAME
  1671. X  pgm - portable graymap file format
  1672. X  .SH DESCRIPTION
  1673. ***************
  1674. *** 76,82 ****
  1675. X  .SH "SEE ALSO"
  1676. X  fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psidtopgm(1),
  1677. X  rawtopgm(1),
  1678. ! pgmbentley(1), pgmedge(1), pgmenhance(1), pgmhist(1), pgmnorm(1),
  1679. X  pgmoil(1), pgmramp(1), pgmtexture(1),
  1680. X  pgmtofits(1), pgmtofs(1), pgmtolispm(1), pgmtopbm(1),
  1681. X  pnm(5), pbm(5), ppm(5)
  1682. --- 76,82 ----
  1683. X  .SH "SEE ALSO"
  1684. X  fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psidtopgm(1),
  1685. X  rawtopgm(1),
  1686. ! pgmbentley(1), pgmcrater(1), pgmedge(1), pgmenhance(1), pgmhist(1), pgmnorm(1),
  1687. X  pgmoil(1), pgmramp(1), pgmtexture(1),
  1688. X  pgmtofits(1), pgmtofs(1), pgmtolispm(1), pgmtopbm(1),
  1689. X  pnm(5), pbm(5), ppm(5)
  1690. diff -cr pbmplus30oct91/pgm/pgmbentley.c pgm/pgmbentley.c
  1691. *** pbmplus30oct91/pgm/pgmbentley.c    Fri Jun 28 14:29:20 1991
  1692. --- pgm/pgmbentley.c    Tue Dec 10 16:54:10 1991
  1693. ***************
  1694. *** 56,61 ****
  1695. --- 56,62 ----
  1696. X          }
  1697. X  
  1698. X      pgm_writepgm( stdout, gout, cols, rows, maxval, 0 );
  1699. +     pm_close( stdout );
  1700. X      pgm_freearray( gout, rows );
  1701. X  
  1702. X      exit( 0 );
  1703. diff -cr pbmplus30oct91/pgm/pgmedge.c pgm/pgmedge.c
  1704. *** pbmplus30oct91/pgm/pgmedge.c    Fri Jun 28 14:29:21 1991
  1705. --- pgm/pgmedge.c    Tue Dec 10 16:54:06 1991
  1706. ***************
  1707. *** 101,105 ****
  1708. --- 101,107 ----
  1709. X      orow[col] = 0;
  1710. X      pgm_writepgmrow( stdout, orow, cols, maxval, 0 );
  1711. X  
  1712. +     pm_close( stdout );
  1713. X      exit( 0 );
  1714. X      }
  1715. diff -cr pbmplus30oct91/pgm/pgmenhance.c pgm/pgmenhance.c
  1716. *** pbmplus30oct91/pgm/pgmenhance.c    Fri Jun 28 14:29:23 1991
  1717. --- pgm/pgmenhance.c    Tue Dec 10 16:53:43 1991
  1718. ***************
  1719. *** 113,123 ****
  1720. X      *ngP = thisrow[cols - 1];
  1721. X      pgm_writepgmrow( stdout, newrow, cols, maxval, 0 );
  1722. X      }
  1723. X  
  1724. X      /* Last row. */
  1725. X      pgm_writepgmrow( stdout, nextrow, cols, maxval, 0 );
  1726. X  
  1727. !     pm_close( ifp );
  1728. X  
  1729. X      exit( 0 );
  1730. X      }
  1731. --- 113,124 ----
  1732. X      *ngP = thisrow[cols - 1];
  1733. X      pgm_writepgmrow( stdout, newrow, cols, maxval, 0 );
  1734. X      }
  1735. +     pm_close( ifp );
  1736. X  
  1737. X      /* Last row. */
  1738. X      pgm_writepgmrow( stdout, nextrow, cols, maxval, 0 );
  1739. X  
  1740. !     pm_close( stdout );
  1741. X  
  1742. X      exit( 0 );
  1743. X      }
  1744. diff -cr pbmplus30oct91/pgm/pgmmerge.c pgm/pgmmerge.c
  1745. *** pbmplus30oct91/pgm/pgmmerge.c    Thu Sep 26 16:52:44 1991
  1746. --- pgm/pgmmerge.c    Tue Dec 10 16:54:05 1991
  1747. ***************
  1748. *** 32,38 ****
  1749. X      goto again;
  1750. X      }
  1751. X  
  1752. ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) m( argc, argv ); }
  1753. X  
  1754. X      TRY("fitstopgm", fitstopgm_main);
  1755. X      TRY("fstopgm", fstopgm_main);
  1756. --- 32,38 ----
  1757. X      goto again;
  1758. X      }
  1759. X  
  1760. ! #define TRY(s,m) { if ( strcmp( cp, s ) == 0 ) exit( m( argc, argv ) ); }
  1761. X  
  1762. X      TRY("fitstopgm", fitstopgm_main);
  1763. X      TRY("fstopgm", fstopgm_main);
  1764. ***************
  1765. *** 39,44 ****
  1766. --- 39,45 ----
  1767. X      TRY("hipstopgm", hipstopgm_main);
  1768. X      TRY("lispmtopgm", lispmtopgm_main);
  1769. X      TRY("pgmbentley", pgmbentley_main);
  1770. +     TRY("pgmcrater", pgmcrater_main);
  1771. X      TRY("pgmedge", pgmedge_main);
  1772. X      TRY("pgmenhance", pgmenhance_main);
  1773. X      TRY("pgmhist", pgmhist_main);
  1774. diff -cr pbmplus30oct91/pgm/pgmnorm.c pgm/pgmnorm.c
  1775. *** pbmplus30oct91/pgm/pgmnorm.c    Fri Jun 28 15:14:52 1991
  1776. --- pgm/pgmnorm.c    Tue Dec 10 16:54:00 1991
  1777. ***************
  1778. *** 177,181 ****
  1779. --- 177,182 ----
  1780. X          }
  1781. X      }
  1782. X  
  1783. +     pm_close( stdout );
  1784. X      exit( 0 );
  1785. X      }
  1786. diff -cr pbmplus30oct91/pgm/pgmoil.c pgm/pgmoil.c
  1787. *** pbmplus30oct91/pgm/pgmoil.c    Wed Oct 30 13:04:36 1991
  1788. --- pgm/pgmoil.c    Tue Dec 10 16:54:11 1991
  1789. ***************
  1790. *** 89,93 ****
  1791. --- 89,94 ----
  1792. X      pgm_writepgmrow( stdout, grayrow, cols, maxval, 0 );
  1793. X      }
  1794. X  
  1795. +     pm_close( stdout );
  1796. X      exit( 0 );
  1797. X      }
  1798. diff -cr pbmplus30oct91/pgm/pgmramp.c pgm/pgmramp.c
  1799. *** pbmplus30oct91/pgm/pgmramp.c    Sat Oct  5 23:08:10 1991
  1800. --- pgm/pgmramp.c    Tue Dec 10 16:54:04 1991
  1801. ***************
  1802. *** 97,101 ****
  1803. --- 97,102 ----
  1804. X      pgm_writepgmrow( stdout, grayrow, cols, PGM_MAXMAXVAL, 0 );
  1805. X      }
  1806. X  
  1807. +     pm_close( stdout );
  1808. X      exit( 0 );
  1809. X      }
  1810. diff -cr pbmplus30oct91/pgm/pgmtopbm.c pgm/pgmtopbm.c
  1811. *** pbmplus30oct91/pgm/pgmtopbm.c    Sun Jul  7 17:29:11 1991
  1812. --- pgm/pgmtopbm.c    Tue Dec 10 16:53:48 1991
  1813. ***************
  1814. *** 146,152 ****
  1815. X  
  1816. X      default:
  1817. X      pm_error( "can't happen" );
  1818. -     exit( 1 );
  1819. X      }
  1820. X  
  1821. X      for ( row = 0; row < rows; ++row )
  1822. --- 146,151 ----
  1823. ***************
  1824. *** 255,261 ****
  1825. X  
  1826. X          default:
  1827. X          pm_error( "can't happen" );
  1828. -         exit( 1 );
  1829. X          }
  1830. X  
  1831. X      pbm_writepbmrow( stdout, bitrow, cols, 0 );
  1832. --- 254,259 ----
  1833. ***************
  1834. *** 262,267 ****
  1835. --- 260,266 ----
  1836. X      }
  1837. X  
  1838. X      pm_close( ifp );
  1839. +     pm_close( stdout );
  1840. X  
  1841. X      exit( 0 );
  1842. X      }
  1843. diff -cr pbmplus30oct91/pgm/psidtopgm.c pgm/psidtopgm.c
  1844. *** pbmplus30oct91/pgm/psidtopgm.c    Fri Jun 28 15:17:11 1991
  1845. --- pgm/psidtopgm.c    Tue Dec 10 16:53:51 1991
  1846. ***************
  1847. *** 105,110 ****
  1848. --- 105,111 ----
  1849. X      pgm_writepgmrow( stdout, grayrow, cols, (gray) maxval, 0 );
  1850. X      }
  1851. X      pm_close( ifp );
  1852. +     pm_close( stdout );
  1853. X  
  1854. X      exit( 0 );
  1855. X      }
  1856. diff -cr pbmplus30oct91/pgm/rawtopgm.c pgm/rawtopgm.c
  1857. *** pbmplus30oct91/pgm/rawtopgm.c    Fri Jun 28 14:29:38 1991
  1858. --- pgm/rawtopgm.c    Tue Dec 10 16:53:46 1991
  1859. ***************
  1860. *** 100,105 ****
  1861. --- 100,106 ----
  1862. X      pgm_writepgmrow( stdout, grayrow, cols, (gray) 255, 0 );
  1863. X      }
  1864. X      pm_close( ifp );
  1865. +     pm_close( stdout );
  1866. X  
  1867. X      exit( 0 );
  1868. X      }
  1869. diff -cr pbmplus30oct91/ppm/Makefile ppm/Makefile
  1870. *** pbmplus30oct91/ppm/Makefile    Thu Oct 24 13:34:40 1991
  1871. --- ppm/Makefile    Tue Dec 10 16:55:21 1991
  1872. ***************
  1873. *** 47,73 ****
  1874. X  
  1875. X  PORTBINARIES =    giftoppm gouldtoppm ilbmtoppm imgtoppm mtvtoppm \
  1876. X          pcxtoppm pgmtoppm pi1toppm picttoppm \
  1877. !         pjtoppm ppmdither ppmhist ppmmake ppmquant \
  1878. !         ppmrelief ppmtogif ppmtoicr ppmtoilbm \
  1879. !         ppmtopcx ppmtopgm ppmtopi1 ppmtopict \
  1880. X          ppmtopj ppmtopuzz ppmtorgb3 ppmtosixel \
  1881. X          ppmtotga ppmtouil ppmtoxpm ppmtoyuv qrttoppm \
  1882. !         rawtoppm rgb3toppm spctoppm sputoppm \
  1883. X          tgatoppm ximtoppm xpmtoppm yuvtoppm
  1884. ! MATHBINARIES =    ppmpat
  1885. X  BINARIES =    $(PORTBINARIES) $(MATHBINARIES)
  1886. X  SCRIPTS =    ppmquantall
  1887. X  
  1888. X  OBJECTS =    giftoppm.o gouldtoppm.o ilbmtoppm.o imgtoppm.o mtvtoppm.o \
  1889. X          pcxtoppm.o pgmtoppm.o pi1toppm.o picttoppm.o \
  1890. !         pjtoppm.o ppmdither.o ppmhist.o ppmmake.o ppmquant.o \
  1891. !         ppmrelief.o ppmtogif.o ppmtoicr.o ppmtoilbm.o \
  1892. !         ppmtopcx.o ppmtopgm.o ppmtopi1.o ppmtopict.o \
  1893. X          ppmtopj.o ppmtopuzz.o ppmtorgb3.o ppmtosixel.o \
  1894. X          ppmtotga.o ppmtouil.o ppmtoxpm.o ppmtoyuv.o qrttoppm.o \
  1895. !         rawtoppm.o rgb3toppm.o spctoppm.o sputoppm.o \
  1896. X          tgatoppm.o ximtoppm.o xpmtoppm.o yuvtoppm.o \
  1897. !         ppmpat.o
  1898. X  
  1899. X  MANUALS1 =    $(BINARIES) $(SCRIPTS)
  1900. X  MANUALS3 =    libppm
  1901. --- 47,73 ----
  1902. X  
  1903. X  PORTBINARIES =    giftoppm gouldtoppm ilbmtoppm imgtoppm mtvtoppm \
  1904. X          pcxtoppm pgmtoppm pi1toppm picttoppm \
  1905. !         pjtoppm ppmdither ppmhist ppmmake \
  1906. !         ppmquant ppmrelief ppmtoacad ppmtogif ppmtoicr \
  1907. !         ppmtoilbm ppmtopcx ppmtopgm ppmtopi1 ppmtopict \
  1908. SHAR_EOF
  1909. true || echo 'restore of p121091.diffs failed'
  1910. fi
  1911. echo 'End of  part 1'
  1912. echo 'File p121091.diffs is continued in part 2'
  1913. echo 2 > _shar_seq_.tmp
  1914. exit 0
  1915. exit 0 # Just in case...
  1916. -- 
  1917. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1918. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1919. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1920. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1921.